//
//  HomeSearchView.m
//  Traveling
//
//  Created by 尹桥印 on 15/7/4.
//  Copyright (c) 2015年 长沙市岳麓区立早网络科技有限公司. All rights reserved.
//

#import "HomeSearchView.h"

@interface HomeSearchView()
@property (weak, nonatomic) IBOutlet UITextField *textField;

@property (nonatomic, copy) void(^block)(NSString *text);
@end
@implementation HomeSearchView


-(void)awakeFromNib{
    [self.textField becomeFirstResponder];
}
-(instancetype)initWithBlock:(void(^)(NSString *text))block{
    self = [[[NSBundle mainBundle] loadNibNamed:@"HomeSearchView" owner:nil options:nil] lastObject];
    self.width = SCREENW;
    if (self) {
        self.block = block;
    }
    return self;
}

- (IBAction)enterBtnClick:(UIButton *)sender {
    if (self.block) {
        self.block(self.textField.text);
    }
}

@end
